package com.gaohe.dcp.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.dcp.mapper.DcpScaleMapper;
import com.gaohe.dcp.domain.DcpScale;
import com.gaohe.dcp.service.IDcpScaleService;

/**
 * 量表管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-23
 */
@Service
public class DcpScaleServiceImpl implements IDcpScaleService 
{
    @Autowired
    private DcpScaleMapper dcpScaleMapper;

    /**
     * 查询量表管理
     * 
     * @param scaleId 量表管理主键
     * @return 量表管理
     */
    @Override
    public DcpScale selectDcpScaleByScaleId(Long scaleId)
    {
        return dcpScaleMapper.selectDcpScaleByScaleId(scaleId);
    }

    /**
     * 查询量表管理列表
     * 
     * @param dcpScale 量表管理
     * @return 量表管理
     */
    @Override
    public List<DcpScale> selectDcpScaleList(DcpScale dcpScale)
    {
        return dcpScaleMapper.selectDcpScaleList(dcpScale);
    }

    /**
     * 新增量表管理
     * 
     * @param dcpScale 量表管理
     * @return 结果
     */
    @Override
    public int insertDcpScale(DcpScale dcpScale)
    {
        dcpScale.setCreateTime(DateUtils.getNowDate());
        return dcpScaleMapper.insertDcpScale(dcpScale);
    }

    /**
     * 修改量表管理
     * 
     * @param dcpScale 量表管理
     * @return 结果
     */
    @Override
    public int updateDcpScale(DcpScale dcpScale)
    {
        dcpScale.setUpdateTime(DateUtils.getNowDate());
        return dcpScaleMapper.updateDcpScale(dcpScale);
    }

    /**
     * 批量删除量表管理
     * 
     * @param scaleIds 需要删除的量表管理主键
     * @return 结果
     */
    @Override
    public int deleteDcpScaleByScaleIds(Long[] scaleIds)
    {
        return dcpScaleMapper.deleteDcpScaleByScaleIds(scaleIds);
    }

    /**
     * 删除量表管理信息
     * 
     * @param scaleId 量表管理主键
     * @return 结果
     */
    @Override
    public int deleteDcpScaleByScaleId(Long scaleId)
    {
        return dcpScaleMapper.deleteDcpScaleByScaleId(scaleId);
    }

    @Override
    public List<DcpScale> getDcpScaleList() {
        return dcpScaleMapper.getDcpScaleList();
    }

    @Override
    public int changeStatus(DcpScale dcpScale) {
        return dcpScaleMapper.updateStatus(dcpScale);
    }


}
